﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Simple.Services;
namespace Simple.WebApi.Controllers.System;

/// <summary>
/// 违章性质管理
/// </summary>
[Route("QHSEXyViolationType/[action]")]
[ApiController]
public class QHSEXyViolationTypeController : ControllerBase
{
    private readonly QHSEXyViolationTypeService _violationTypeService;

    public QHSEXyViolationTypeController(QHSEXyViolationTypeService violationTypeService)
    {
        _violationTypeService = violationTypeService;
    }

    /// <summary>
    /// 违章性质列表
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    [CustomAuthorize("hdv_qhse_data")]
    public async Task<AppResult> List()
    {
        List<QHSEXyViolationTypeModel> data = await _violationTypeService.GetAsync();
        return AppResult.Status200OK(data: data);
    }
    [HttpGet]
    [ValidateTimestampAndSignature]
    public async Task<AppResult> List1()
    {
        List<QHSEXyViolationTypeModel> data = await _violationTypeService.GetAsync();
        return AppResult.Status200OK(data: data);
    }
}

